package main

import "fmt"

// 结构体定义

type Student struct {
	*Person
	addr string
}

type Person struct {
	id   int
	name string
	age  int
}

func main() {
	var s1 = Student{&Person{1, "张三", 18}, "北京"}
	var s2 = Student{&Person{2, "李四", 20}, "北京"}
	fmt.Println(s1)
	fmt.Println(s2)
	var s3 Student
	var p Person
	p.id = 102
	p.name = "老王"
	p.age = 12
	s3.Person = &p
	s3.addr = "北京"
	fmt.Println(s3)
}
